﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>


    <style>
        body {
            padding-bottom: 10px;
        }

        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }

        .el-col {
            padding: 10px;
            font-size: 14px;
        }
        td {
            padding: 10px;
            font-size: 14px;
        }

        .el-form-item {
            margin-bottom: 0px !important;
        }

        .el-input-group__prepend,
        .el-input__inner,
        .el-form-item__label {
            color: #000;
            font-size: 14px;
        }


        .el-input__inner{
            color: #606266!important
        }

        .el-form-item__label{
            padding-left: 0!important;
        }

        .el-input-group__prepend {
            padding-left: 0
        }
    </style>
</head>
<body>
    
<div id="app" v-cloak>   
        <div style="width:100%;text-align:center ">
            <label style="font-weight:bold">断路作业安全许可证</label>
        </div>
        <div style="width:100%;text-align:right ">
            <label>  {{OpenCircuitSafetyPermit.ApplicationNumber+mark.m}} {{Form.ApplicationNumber}}</label>
        </div>
        <el-form :model="Form" status-icon style="margin-top:5px;width:100%" class="safeCard">
            <!--<el-row type="flex" justify="end">
            <el-col span="23">
                {{OpenCircuitSafetyPermit.ApplicationNumber+mark.m}} {{Form.ApplicationNumber}}
            </el-col>
        </el-row>-->
            <table style="border:1px  solid; width:100%" cellpadding="0" cellspacing="0">
                <!--<tr>
                <td width="50%" style="border-right:1px solid;border-bottom:1px solid  ">
                    {{OpenCircuitSafetyPermit.ApplicationUnit}}  {{Form.ApplicationUnit}}
                </td>
                <td width="50%" style="border-bottom:1px solid">

                    {{OpenCircuitSafetyPermit.applicant}}  {{Form.applicant}}
                </td>
            </tr>-->
                <tr>
                    <td width="50%" style="border-bottom:1px solid;border-right:1px solid;" rowspan="2">
                        <el-form-item :label="OpenCircuitSafetyPermit.CauseDisconnection+mark.m" prop="CauseDisconnection" class="inputTextarea">
                            <el-input type="textarea" v-model="Form.CauseDisconnection" autocomplete="off"></el-input>
                        </el-form-item>
                    </td>
                    <td width="50%" style="border-bottom:1px solid ; ">
                        {{OpenCircuitSafetyPermit.ApplicationUnit}}  {{Form.ApplicationUnit}}
                    </td>
                </tr>
                <tr>
                    <td width="50%" style="border-bottom:1px solid">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{OpenCircuitSafetyPermit.OperatingUnit+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.OperatingUnit" slot="suffix" :placeholder="OpenCircuitSafetyPermit.OperatingUnit">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in OperatingUnit" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="50%" style="border-bottom:1px solid;border-right:1px solid;">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.JobManagere" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{OpenCircuitSafetyPermit.JobManagere+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                    <td width="50%" style="border-bottom:1px solid  ">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{EarthmovingWorkSafetyPermit.contractor+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.contractor" slot="suffix" :placeholder="EarthmovingWorkSafetyPermit.contractor">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in contractor" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td width="50%" style="border-bottom:1px solid;">
                        <el-form-item :label="OpenCircuitSafetyPermit.JobStartTime+mark.m" class="inputTextarea">
                            <el-date-picker v-model="Form.JobStartTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
                                            placeholder="选择时间">
                            </el-date-picker>
                        </el-form-item>
                        </td>
                    <td width="50%" style="border-bottom:1px solid;">
                        <el-form-item :label="OpenCircuitSafetyPermit.JobEndTime+mark.m" class="inputTextarea">
                            <el-date-picker v-model="Form.JobEndTime" type="datetime" placeholder="选择时间" value-format="yyyy-MM-dd HH:mm:ss">
                            </el-date-picker>
                        </el-form-item>
              
                        <!--<div class="elst-select-mini">
            <el-form-item :label="OpenCircuitSafetyPermit.JobStartTime+mark.m" size="mini">
                <el-date-picker v-model="Form.JobStartTime" type="daterange" range-separator="至"
                                start-placeholder="开始日期" end-placeholder="结束日期" size="mini">
                </el-date-picker>
            </el-form-item>
        </div>-->
                    </td>

                </tr>
                <tr>
                    <td colspan="2" width="100%" style="">

                        <el-form-item :label="OpenCircuitSafetyPermit.SchematicDiagram+mark.m">
                            <el-input type="textarea"  v-model="Form.SchematicDiagram"></el-input>
                        </el-form-item>
                    </td>
                </tr>
            </table>


            <!--安全措施-->
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" >
                    <el-table :data="Form.HazardIdentification" border>
                        <el-table-column prop="SafetyMeasures"
                                         :label="OpenCircuitSafetyPermit.SafetyMeasures">
                        </el-table-column>

                        <el-table-column :label="OpenCircuitSafetyPermit.Department" width="180px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.Department" placeholder="请选择">
                                    <el-option v-for="item in TerritorialDepartment" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="OpenCircuitSafetyPermit.Confirmor" width="130px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.Confirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <!--基于数据库管控要求-->
            <!--<el-row style="border:1px  solid;border-top:0px;  ">
                <el-col span="24">
                    <label>{{OpenCircuitSafetyPermit.BasedDatabaseManagementRequirements+mark.m}}</label>
                    <a href="javascript:void(0)" v-on:click="RiskInformationBase('tj')">添加</a>
                </el-col>
            </el-row>
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.BasedDatabaseManagementRequirements"
                              border
                              style="width: 90%">
                        <el-table-column prop="Risk"
                                         :label="EquipmenFacilities.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="OpenCircuitSafetyPermit.ControlRequirements">
                        </el-table-column>

                        <el-table-column :label="OpenCircuitSafetyPermit.ControlDepartment" width="180px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ControlDepartment" placeholder="请选择">
                                    <el-option v-for="item in TerritorialDepartment" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="OpenCircuitSafetyPermit.ControlConfirmor" width="130px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ControlConfirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>-->


            <!--受影响相关方-->
            <el-row style="border:1px  solid;border-top:0px; text-align: left ">
                <el-col span="24">
                    <label>{{HotWorkSafetyLicense.AffectedParties+mark.m}}</label><a href="javascript:void(0)" @click="AffectedPartiesInput('tj')">添加</a>
                </el-col>
            </el-row>
            <!--受影响相关方数据-->
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.AffectedParties" border >
                        <el-table-column :label="HotWorkSafetyLicense.AffectedPartiesUnit">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.AffectedPartiesUnit" placeholder="请选择">
                                    <el-option v-for="item in OperatingUnit" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="HotWorkSafetyLicense.AffectedPartiesConfirmor">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.AffectedPartiesConfirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.AffectedPartiesUnit)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>



            <!--审批人-->
            <el-row style="border:1px  solid;border-top:0px; text-align: left ">
                <el-col span="24">
                    <label>{{OpenCircuitSafetyPermit.Approver+mark.m}}</label><a href="javascript:void(0)" @click="ApproverInput('tj')">添加</a>
                </el-col>
            </el-row>
            <!--审批人数据-->
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.Approver" border >
                        <el-table-column :label="OpenCircuitSafetyPermit.ApproverUnit">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ApproverUnit" placeholder="请选择">
                                    <el-option v-for="item in OperatingUnit" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="OpenCircuitSafetyPermit.ApproverConfirmor">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ApproverConfirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.Approver)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>


            <!--断路申请单位负责人-->
            <el-row style="border:1px  solid;border-top:0px; text-align: left ">
                <el-col span="24">
                    <label>{{OpenCircuitSafetyPermit.Disconnection+mark.m}}</label><a href="javascript:void(0)" @click="DisconnectionInput('tj')">添加</a>
                </el-col>
            </el-row>
            <!--断路申请单位负责人数据-->
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.Disconnection" border>
                        <el-table-column :label="OpenCircuitSafetyPermit.DisconnectionUnit">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.DisconnectionUnit" placeholder="请选择">
                                    <el-option v-for="item in OperatingUnit" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="OpenCircuitSafetyPermit.DisconnectionConfirmor">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.DisconnectionConfirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.Disconnection)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog :title="title" :visible.sync="ListItem.dialogVisible" width="90%" height="95%" top="10vh" fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: {
                id: '',
                title:'',
                Form: {
                    id: guidEmpty,
                    CauseDisconnection: "",
                    ApplicationUnit: "",
                    ApplicationNumber: "",
                    ApplicationTime: "",
                    applicant: "",
                    CurrentJob: "",
                    OperatingUnit: "",
                    JobManagere: "",
                    JobLocation: "",
                    JobStartTime: "",
                    JobEndTime: "",
                    SchematicDiagram: "",
                    contractor: "",
                    SafetyMeasures: "",
                    Department: "",
                    Confirmor: "",
                    BasedDatabaseManagementRequirements: "",
                    ControlRequirements: "",
                    ControlDepartment: "",
                    ControlConfirmor: "",
                    AffectedParties: "",
                    AffectedPartiesUnit: "",
                    AffectedPartiesConfirmor: "",
                    Approver: "",
                    ApproverUnit: "",
                    ApproverConfirmor: "",
                    Disconnection: "",
                    DisconnectionUnit: "",
                    DisconnectionConfirmor: "",
                },
                TerritorialDepartment: [],
                IsSafeWorkProgram: [],
                contractor: [],
                Confirmor: [],
                OperatingUnit: [],
                rules: {},
                BasedDatabaseManagementRequirements: [],
                ListItem: ListItem,
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleNodeClick: function (data) {
                    console.log(data);
                },
                handleSelect: function(ev) {
                    console.log(ev);
                },
                handleChecked: function (value) {
                },
                handleCheckedConfirmation: function (value) {
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                getData: function () {
                    getDataAdd(this, '/api/OpenCircuitSafetyPermit/get?id=' + this.id);
                },

                DisconnectionInput: function (val, id) {
                    this.title = "断路申请单位负责人管理";
                    DialogShow(this, val, "DisconnectionInput.html", id);
                },
                ApproverInput: function (val, id) {
                    this.title = "审批人管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/ApproverInput.html", id);
                },

                AffectedPartiesInput: function (val, id) {
                    this.title = "受影响相关方管理";
                    DialogShow(this, val, "../HotWorkSafetyLicense/AffectedPartiesInput.html", id);
                },
                RiskInformationBase: function (val, id) {
                    this.title = "基于数据库管控要求管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/RiskInformationBase.html", id);
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    //this.$refs[formName].validate(function (valid) {
                    //    //验证通过
                    //    if (valid) {
                    onSubmitForm(this, '/api/OpenCircuitSafetyPermit/Save', mythis.Form);
                    //} else {
                    //    //验证失败
                    //    return false;
                    //}
                    //});
                },
            },
            mounted: function () {
                var list = getDicDataArray(['14', '50', '12', '09', '08']);
                this.OperatingUnit = getDicDatafromArray('08', list);
                this.TerritorialDepartment = getDicDatafromArray('14', list);//工作类型
                this.IsSafeWorkProgram = getDicDatafromArray('50', list);//工作类型
                this.contractor = getDicDatafromArray('12', list);//承包商
                this.Confirmor = getDicDatafromArray("09", list);//批准人
                this.id = getUrlParam("id");
                this.getData();
                //this.BasedDatabaseManagementRequirements = this.Form.BasedDatabaseManagementRequirements;
            }
        });
    </script>
</body>
</html>